package cn.skyquant.quant4j.jforex.sdk.strategy2;

import cn.skyquant.quant4j.sdk.enums.TradeDirection;
import cn.skyquant.quant4j.sdk.util.constant.EAConstants;
import com.dukascopy.api.Instrument;

public abstract class InstrumentConfig extends AbstractConfig {
    public final Instrument instrument;
    public final TradeDirection td;

    public InstrumentConfig(QuantStrategy strategy, int index, double m, Instrument instrument, TradeDirection td) {
        super(strategy, index, m);
        this.instrument = instrument;
        this.td = td;
    }

    @Override
    public boolean isValid() {
        return instrument!=null && td!=null;
    }

    @Override
    public String toString() {
        return name + EAConstants.split + eaId + EAConstants.split + index + EAConstants.split + instrument.name() + EAConstants.split + td.name();
    }
}
